package com.vichat.user.service;

import com.vichat.common.vo.PageFilter;
import com.vichat.user.entity.CcsSecFunction;
import com.vichat.user.entity.CcsSecRole;
import com.vichat.user.entity.CcsSecRoleFunction;
import com.vichat.user.vo.PrivilegeVO;
import com.vichat.user.vo.RoleMenuVO;

import java.util.List;

/**
 * Created by user on 2017/11/15.
 */
public interface ICcsSecService {

    /**
     * 返回角色信息（无参数）
     *
     * @return
     */
    public List<CcsSecRole> querySecRole();

    /**
     * 根据条件查询角色信息
     *
     * @param queryBean
     * @return
     */
    public List<CcsSecRole> querySecRole(CcsSecRole queryBean, PageFilter pf);

    /**
     * 查询角色数量
     *
     * @param queryBean
     * @return
     */
    public Long countSecRole(CcsSecRole queryBean) throws Exception;

    /**
     * 添加或者修改角色
     *
     * @param secRole
     * @throws Exception
     */
    public void saveOrUpdSecRole(CcsSecRole secRole) throws Exception;

    /**
     * 根据角色编号获取角色信息
     *
     * @param roid
     */
    public CcsSecRole querySecRoleByRoid(long roid) throws Exception;

    /**
     * 根据角色编号删除角色
     *
     * @param roid
     */
    public void delSecRole(long roid);


    /**
     * 返回菜单信息
     * 无参数
     *
     * @return
     */
    public List<CcsSecFunction> querySecFunction();

    /**
     * 根据条件查询菜单信息
     *
     * @param queryBean
     * @return
     */
    public List<CcsSecFunction> querySecFunction(CcsSecFunction queryBean, PageFilter pf);

    /**
     * 查询菜单数量
     *
     * @param queryBean
     * @return
     */
    public Long countSecFunction(CcsSecFunction queryBean) throws Exception;

    /**
     * 根据菜单编号获取菜单信息
     *
     * @param fid
     */
    public CcsSecFunction querySecFuncByFid(long fid) throws Exception;

    /**
     * 根据角色编号查询菜单分配信息
     *
     * @param roid
     * @return
     */
    public List<CcsSecFunction> querySecRoleFuncVOByRoid(long roid);


    /**
     * 根据菜单编号获取菜单信息
     *
     * @param roid
     */
    public List<CcsSecRoleFunction> querySecRoleFunctionByRoid(long roid);

    /**
     * @param @param  queryBean
     * @param @return
     * @return boolean
     * @throws
     * @Title: repeatSecRole
     * @Description: 判断角色菜单是否重复
     */
    public boolean repeatSecRole(CcsSecRole queryBean);

    /**
     * @param
     * @return
     * @throws
     * @Title: saveSecRoleFunction
     * @Description: 角色分配菜单
     */
    public void saveSecRoleFunction(RoleMenuVO roleMenuVO);


    /**
     * 根据角色编号查询菜单
     *
     * @param uid
     * @return
     */
    public List<PrivilegeVO> querySecPrivilege(long uid);

    /**
     * 根据条件查询角色信息
     *
     * @param uid
     * @return
     */
    public CcsSecRole querySecRoleByUid(Long uid);

    /**
     * 修改用户角色权限
     *
     * @param uid
     * @param roid
     */
    public void saveUserSecRoleRel(Long uid, Long roid);

    public List<CcsSecFunction> getUserEnableFunction(Long CcsUid);

}
